package cn.iocoder.yudao.module.bk.dal.mysql.publisher;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.bk.controller.admin.publisher.vo.PublisherPageReqVO;
import cn.iocoder.yudao.module.bk.dal.dataobject.publisher.PublisherDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 认证出版社 Mapper
 *
 * @author qq
 */
@Mapper
public interface PublisherMapper extends BaseMapperX<PublisherDO> {

    default PageResult<PublisherDO> selectPage(PublisherPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PublisherDO>()
                .likeIfPresent(PublisherDO::getName, reqVO.getName())
                .eqIfPresent(PublisherDO::getType, reqVO.getType())
                .eqIfPresent(PublisherDO::getStatus, reqVO.getStatus())
                .orderByDesc(PublisherDO::getId));
    }

}
